import 'package:json_annotation/json_annotation.dart';

part 'ConfigModel.g.dart';

@JsonSerializable(explicitToJson: true)
class ConfigModel {
    final bool encrypt;
    final String? publicKey;
    final String theme;
    final String? title;
    final String? copyRight;

    ConfigModel({
        required this.encrypt,
        required this.theme,
        required this.title,
        required this.copyRight,
         this.publicKey,
    });

    /// Factory constructor to create a ConfigModel from a JSON map.
    /// The [fromJsonT] function is used to convert the JSON data to the generic type [T].
    /// If the generic type [T] is a map, the [fromJsonT] function is not used and an empty map is returned.
    factory ConfigModel.fromJson(Map<String, dynamic> json) => _$ConfigModelFromJson(json);
    /// Converts the ConfigModel to a JSON map.
    /// The [toJsonT] function is used to convert the generic type [T] to a JSON-compatible format.
    /// If [T] is a Map, it will be serialized as an empty map if [data] is null.
    Map<String, dynamic> toJson() => _$ConfigModelToJson(this);

}